package com.jnks.exception;

import lombok.Data;

import java.io.Serializable;

@Data
public class BizException extends RuntimeException implements Serializable {

    private static final long serialVersionUID = 1L;

    private static final String errorCode = "500";

    private String code;

    private String message;

    public BizException(){}

    /**
     * 抛出时，需指定错误码和错误消息
     * @param code
     * @param message
     */
    public BizException(String code, String message) {
        super();
        this.code = code;
        this.message = message;
    }


    /**
     * 抛出时，错误消息
     * @param
     * @param message
     */
    public BizException(String message) {
        super();
        this.code = errorCode;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

}

